cmake_minimum_required(VERSION 3.5)

project(a.out)

set(CMAKE_BUILD_TYPE Debug)

# if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
#     set(CMAKE_CXX_FLAGS "-fsanitize=undefined,address,leak -fno-omit-frame-pointer")
#     set(CMAKE_C_FLAGS "-fsanitize=undefined,address,leak -fno-omit-frame-pointer")
#     set(CMAKE_L_FLAGS "-fsanitize=undefined,address,leak -fno-omit-frame-pointer")
# endif()

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(glfw3 REQUIRED)
find_package(GLEW REQUIRED)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../src libassgl)

include_directories(
    /usr/include/freetype2
    ${CMAKE_CURRENT_SOURCE_DIR}/../src
)

message("PROJECT_NAME:${PROJECT_NAME}")
file(GLOB project_file main.cpp 
    )

add_executable(${PROJECT_NAME} ${project_file})

target_link_libraries(${PROJECT_NAME}
    -lglfw
    -lGL
    -lm
    -lXrandr
    -lX11
    -lpthread
    -ldl
    glut

    freetype GLEW::GLEW  freeimage

    libassgl
    )
